package 通用数据转换器;

public class 通用数据转换器
{
    public static void main(String[] args){
        AllUserInfo source=new AllUserInfo("hwm",23,"4115232001");
        PartUserInfo target=DtoConverter.convert(source,PartUserInfo.class);
        System.out.println(target);
    }
}
class PartUserInfo{
    String name;
    int age;

    @Override
    public String toString()
    {
        return "PartUserInfo{" + "name='" + name + '\'' + ", age=" + age + '}';
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public int getAge()
    {
        return age;
    }

    public void setAge(int age)
    {
        this.age = age;
    }

    PartUserInfo(String name, int age){
        this.age=age;
        this.name=name;
    }
    PartUserInfo(){
    }
}
class AllUserInfo{
    String name;
    int age;
    String code;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public int getAge()
    {
        return age;
    }

    public void setAge(int age)
    {
        this.age = age;
    }

    public String getCode()
    {
        return code;
    }

    public void setCode(String code)
    {
        this.code = code;
    }

    AllUserInfo(String name, int age, String code)
    {
        this.name=name;
        this.age=age;
        this.code=code;
    }
}
